package lesson04;

import javax.swing.*;
import java.awt.*;

public class JButtonDemo03 extends JFrame {

    public  JButtonDemo03(){
        Container container=getContentPane();
//    //将一个图片变为图标
//    URL resource=JButtonDemo01.class.getResource("tx.jpg");
//    Icon icon=new ImageIcon(resource);

      //多选框
        JCheckBox checkBox1=new JCheckBox("checkBox01");
        JCheckBox checkBox2=new JCheckBox("checkBox02");

        //放容器里面
        container.add(checkBox1,BorderLayout.WEST);
        container.add(checkBox2,BorderLayout.EAST);

        setVisible(true);
        setBounds(200,200,400,400);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        new JButtonDemo03();}
}
